package com.hjjt.cameraplugin

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity


/**
 *
 * @ProjectName:    CameraLib
 * @Package:        com.hjjt.plugin
 * @ClassName:      CameraHelperInstace
 * @Description:    相机帮助类
 * @Author:         孙浩
 * @CreateDate:     2022/6/6 13:48
 */
interface CameraHelper {

    fun openCamera(
        cameraEngineType: CameraEngineConfig.CameraEngineType,
        activity: FragmentActivity,
        parentViewId: Int,
        angle: CameraEngineConfig.Angle,
        callBack:(code:Int,msg:String,data: ImageData?) -> Unit
    )

    fun openCamera(
        cameraEngineType: CameraEngineConfig.CameraEngineType,
        fragment: Fragment,
        parentViewId: Int,
        angle: CameraEngineConfig.Angle,callBack: (code: Int, msg: String, data: ImageData?) -> Unit
    )

    fun captureImage(isBase64: Boolean, timeout:Long, callBack: (image: ImageData) -> Unit, errorCallBack:()->Unit)

    fun closeCamera()

}